-
Notifications
You must be signed in to change notification settings - Fork 966
Introduce RUSTUP_DOWNLOAD_TIMEOUT
to override the download timeout
#4440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Introduce RUSTUP_DOWNLOAD_TIMEOUT
to override the download timeout
#4440
Conversation
bf699dd
to
d19ffb2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see that you are now passing Duration
by value!
d19ffb2
to
f22b590
Compare
This change is needed to allow us to pass an argument for the creation of the client, as it is being done in `rustls_client()`.
…ng download timeout As some (corporate) firewalls take too much time to verify the downloads, the timeout is reached and the user cannot complete its installation. Besides changing the timeout from 30 secs to 3 mins, a new environment variable is introduced to allow users to override the timeout value to their taste.
f22b590
to
31c31d8
Compare
@@ -620,12 +635,13 @@ mod reqwest_be { | |||
static CLIENT_RUSTLS_TLS: OnceLock<Client> = OnceLock::new(); | |||
|
|||
#[cfg(feature = "reqwest-native-tls")] | |||
pub(super) fn native_tls_client() -> Result<&'static Client, DownloadError> { | |||
pub(super) fn native_tls_client(timeout: Duration) -> Result<&'static Client, DownloadError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth commenting that the timeout being passed in does nothing when CLIENT_NATIVE_TLS
is already initialized (idem for CLIENT_RUSTLS_TLS
)?
Fixes #4439.
Besides increasing the default timeout from 30 seconds to 3 minutes, a new environment variable (
RUSTUP_DOWNLOAD_TIMEOUT
) is introduced to allow users to override this value.